package com.anti.modular.owner.ownerleasebill.service;

import com.anti.jdbc.support.page.PageParam;
import com.anti.jdbc.support.page.PageResult;
import com.anti.modular.owner.ownerlease.entity.OwnerLease;
import com.anti.modular.owner.ownerleasebill.entity.OwnerLeaseBill;
import com.anti.modular.owner.ownerleasebill.param.OwnerLeaseBillEditParam;
import com.anti.modular.owner.ownerleasebill.param.OwnerLeaseBillParam;
import com.anti.modular.owner.ownerleasebill.result.*;
import com.anti.modular.owner.ownerleasefees.entity.OwnerLeaseFees;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 業主賬單service接口
 *
 * @author anti
 * @date 2021-05-20 14:25:38
 */
public interface OwnerLeaseBillService{

    /**
    * 根据主键查询实体
    */
    OwnerLeaseBill getById(OwnerLeaseBillParam ownerLeaseBillParam);

    /**
     * 获取当前正在生效的账单
     * @param leaseId
     * @return
     */
    OwnerLeaseBill getNowYxById(Long leaseId);

    /**
     * 查询業主賬單
     *
     * @author anti
     * @date 2021-05-20 14:25:38
     */
    PageResult page(PageParam pageParam,OwnerLeaseBillParam ownerLeaseBillParam);

    OwnerLeaseNumResult getOwnerBillNum();

    PageResult ownerLeaseBillPageByLeaseId(PageParam pageParam,OwnerLeaseBillParam ownerLeaseBillParam);

    /**
     * 業主賬單列表
     *
     * @author anti
     * @date 2021-05-20 14:25:38
     */
    List<OwnerLeaseBill> list(OwnerLeaseBillParam ownerLeaseBillParam);

    /**
     * 添加業主賬單
     *
     * @author anti
     * @date 2021-05-20 14:25:38
     */
    void add(OwnerLeaseBillParam ownerLeaseBillParam);

    void addBillListByLease(OwnerLease ownerLease,List<OwnerLeaseFees> ownerLeaseFees);

    /**
     * 生成清算賬單
     * @param ownerLease
     */
    void addQsBillListByLease(OwnerLease ownerLease,int maxQs);

    /**
     * 生成續租賬單
     * @param maxQs
     * @param ownerLease
     * @param start
     * @param end
     */
    void addXuZuBillListByLease(int maxQs, OwnerLease ownerLease, Date start,Date end);

    /**
     * 账单周期修改 重新生成账单及当前账单
     * @param maxQs
     * @param ownerLease
     */
    void addNewBillPlanByLease(int maxQs, OwnerLease ownerLease, OwnerLeaseBill nowLease,List<OwnerLeaseFees> ownerLeaseFees);

    /**
     * 删除業主賬單
     *
     * @author anti
     * @date 2021-05-20 14:25:38
     */
    void delete(OwnerLeaseBillParam ownerLeaseBillParam);

    /**
     * 编辑業主賬單
     *
     * @author anti
     * @date 2021-05-20 14:25:38
     */
    void edit(OwnerLeaseBillEditParam ownerLeaseBillParam);

    void editJz(OwnerLeaseBillParam ownerLeaseBillParam);

    void editQsTz(OwnerLeaseBillParam ownerLeaseBillParam);

    void editBillPlan(LeaseBillPlanResult ownerLeaseBillParam);


    void editCxdz(OwnerLeaseBillParam ownerLeaseBillParam);

    /**
     * 查看業主賬單
     *
     * @author anti
     * @date 2021-05-20 14:25:38
     */
    OwnerLeaseBill detail(OwnerLeaseBillParam ownerLeaseBillParam);

    LeaseBillPlanResult detailByBillId(OwnerLeaseBillParam ownerLeaseBillParam);

    OwnerBillDetaillReadResult getOwnerBillDetailReadOnly(Long billId);

    OwnerBillDetaillEditResult getOwnerBillDetailForEdit(Long billId);

    List<OwnerLeaseBillPlanResult> getBillListByLeaseId(Long leaseId);

}
